package devkit.commando {
	
	import mx.collections.ArrayCollection;
	
	/**
	 * Class used to maintain a list of the commands that are currently being fired off.
	 * @author Francois Dempers
	 */
	public class ProcessChain extends ArrayCollection {
		
		/**
		 * Adds a command class to the list of executing commands.
		 * @param command The instance of a <code>CommandBase</code> to add.
		 */
		public function addCommand(command:CommandBase):void {
			
			addItem(command);
		}
		
		/**
		 * Removes a command class from the list of executing commands.
		 * @param command The instance of a <code>CommandBase</code> to remove.
		 */
		public function removeCommand(command:CommandBase):void {
			
			var index:int = getItemIndex(command);
			if(index != -1) {
				removeItemAt(index);
			}
		}
	}
}